package com.jzo2o.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum SmsBussinessTypeEnum {
    INSTITION_REGISTER(1), INSTITUTION_RESET_PASSWORD(2), SERVE_STAFF_LOGIN(3);

    private final int type;

    /**
     * 根据类型值获取对应的枚举实例
     *
     * @param type 枚举实例对应的类型值
     * @return 匹配的枚举实例，如果未找到则返回 null
     */
    public static SmsBussinessTypeEnum getByType(int type) {
        for (SmsBussinessTypeEnum value : SmsBussinessTypeEnum.values()) {
            if (value.type == type) {
                return value;
            }
        }
        return null;
    }
}

